//
//  globalDefine.h
//  iOSDevelopSDK
//
//  Created by Hayder on 2019/6/13.
//  Copyright © 2019 Hayder. All rights reserved.
//

#import "HHCategoryHeader.h"
#import "HHDevelopKitConfig.h"

#pragma mark ---------------------打印----------------------------
#ifdef DEBUG
#define NSLog(FORMAT, ...) {\
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];\
[dateFormatter setDateStyle:NSDateFormatterMediumStyle];\
[dateFormatter setTimeStyle:NSDateFormatterShortStyle];\
NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"];\
[dateFormatter setTimeZone:timeZone];\
[dateFormatter setDateFormat:@"HH:mm:ss.SSSSSSZ"];\
NSString *str = [dateFormatter stringFromDate:[NSDate date]];\
fprintf(stderr,"--------------时间：%s【FILE：%s--LINE：%d】--------\n方法：\n  %s\n%s\n",[str UTF8String],[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__,__PRETTY_FUNCTION__,[[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);\
}
#else
# define NSLog(...);
#endif

//导航栏和安全距离高度
#define StatusBar_Height [UIDevice vg_safeDistanceTop]
#define NavBar_Height [UIDevice vg_navigationFullHeight]
#define TabBar_Height [UIDevice vg_tabBarFullHeight]
#define KPhonexSafeBottomHeight [UIDevice vg_safeDistanceBottom];

#pragma mark ---------------------常规定义----------------------------
#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;
//屏幕宽高 
#define HH_SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define HH_SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)

//导航栏和安全距离高度
#define Font(size) [UIFont systemFontOfSize:size]
#define BoldFont(size) [UIFont boldSystemFontOfSize:size]
#define FontHeight(size) Font(size).lineHeight

#pragma mark ---------------------图片----------------------------
#define BundlePngImage(imageName) [UIImage imageWithContentsOfFile: [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"HH_DEVE_KIT" ofType:@"bundle"]] pathForResource:imageName ofType:@"png"]]

#define BundleJpgImage(imageName) [UIImage imageWithContentsOfFile: [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"HH_DEVE_KIT" ofType:@"bundle"]] pathForResource:imageName ofType:@"jpeg"]]
#pragma mark ---------------------颜色----------------------------
#define kThemeColor  [HHDevelopKitConfig config].themeColor

#define HHRGBA(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
#define HHRGB(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1]

#define ColorHexString(colorString) [UIColor colorWithHexString:colorString]

#define PBColorHexString(rgbValue,alphaValue,dradRgbValue,darkAlphaValue) \
[UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0x00FF00) >> 8))/255.0 blue:((float)(rgbValue & 0x0000FF))/255.0 alpha:alphaValue]

// 51灰
#define kGray_51 [UIColor colorWithRed:51.0/255.0 green:51.0/255.0 blue:51.0/255.0 alpha:1.0]
// 68灰
#define kGray_68 [UIColor colorWithRed:68.0/255.0 green:68.0/255.0 blue:68.0/255.0 alpha:1.0]
// 85灰
#define kGray_85 [UIColor colorWithRed:85.0/255.0 green:85.0/255.0 blue:85.0/255.0 alpha:1.0]
// 105灰
#define kGray_105 [UIColor colorWithRed:105.0/255.0 green:105.0/255.0 blue:105.0/255.0 alpha:1.0]
// 150灰
#define kGray_150 [UIColor colorWithRed:150.0/255.0 green:150.0/255.0 blue:150.0/255.0 alpha:1.0]
// 182灰
#define kGray_182 [UIColor colorWithRed:182.0/255.0 green:182.0/255.0 blue:182.0/255.0 alpha:1.0]
// 200灰
#define kGray_200 [UIColor colorWithRed:200/255.0 green:200/255.0 blue:200/255.0 alpha:1.0]
// 230灰
#define kGray_230 [UIColor colorWithRed:230.0/255.0 green:230.0/255.0 blue:230.0/255.0 alpha:1.0]
// 240灰
#define kGray_240 [UIColor colorWithRed:240/255.0 green:240/255.0 blue:240/255.0 alpha:1.0]
// 250灰
#define kGray_250 [UIColor colorWithRed:250/255.0 green:250/255.0 blue:250/255.0 alpha:1.0]

#pragma mark ---------------------系统信息----------------------------
#define iOSVersion  [[UIDevice currentDevice].systemVersion doubleValue]
// 是否为iOS9
#define kisiOS9 (iOSVersion >= 9.0)
// 是否为iOS10
#define kisiOS10 (iOSVersion >= 10.0)
// 是否为iOS11
#define kisiOS11 (iOSVersion >= 11.0)
